<template>
  <div>
    <button @click="isShow = !isShow">是否显示</button>
    <transition name="h11" appear>
      <h1 class="h1" v-show="isShow">UseAnimation 实现动画效果</h1>
    </transition>
  </div>
</template>

<script>
export default {
  name: 'UseAnimation',
  data() {
    return {
      isShow: true
    }
  }
}
</script>

<style lang="less" scoped>
.h1 {
  background-color: orange;
}

.h11-enter-active {
  animation: move 1s;
}
.h11-leave-active {
  animation: move 1s reverse;
}

@keyframes move {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}
</style>